#region Header

// <file>
//     <copyright see="prj:///doc/copyright.txt"/>
//     <license see="prj:///doc/license.txt"/>
//     <owner name="none" email=""/>
//     <version>$Revision: 2997 $</version>
// </file>

#endregion Header

namespace ICSharpCode.TextEditor.Document
{
    using System.Drawing;
    using System.Text;

    #region Enumerations

    public enum BracketMatchingStyle
    {
        Before,
        After
    }

    #endregion Enumerations

    public class DefaultTextEditorProperties : ITextEditorProperties
    {
        #region Fields

        static Font DefaultFont;

        bool allowCaretBeyondEOL = false;
        bool autoInsertCurlyBracket = true;
        BracketMatchingStyle bracketMatchingStyle = BracketMatchingStyle.After;
        bool convertTabsToSpaces = false;
        bool cutCopyWholeLine = true;
        DocumentSelectionMode documentSelectionMode = DocumentSelectionMode.Normal;
        bool enableFolding = true;
        Encoding encoding = System.Text.Encoding.UTF8;
        FontContainer fontContainer;
        bool hideMouseCursor = false;
        IndentStyle indentStyle = IndentStyle.Smart;
        int indentationSize = 4;
        bool isIconBarVisible = false;
        string lineTerminator = "\r\n";
        LineViewerStyle lineViewerStyle = LineViewerStyle.None;
        bool mouseWheelScrollDown = true;
        bool mouseWheelTextZoom = true;
        bool showEOLMarker = false;
        bool showHorizontalRuler = false;
        bool showInvalidLines = false;
        bool showLineNumbers = true;
        bool showMatchingBracket = true;
        bool showSpaces = false;
        bool showTabs = false;
        bool showVerticalRuler = true;
        int tabIndent = 4;
        System.Drawing.Text.TextRenderingHint textRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault;
        bool useCustomLine = false;
        int verticalRulerRow = 80;

        Color bracketHighlightOutlineColor;
        Color bracketHighlightInnerColor;

        #endregion Fields

        #region Constructors

        public DefaultTextEditorProperties()
        {
            if (DefaultFont == null) {
                DefaultFont = new Font("Courier New", 10);
            }
            this.fontContainer = new FontContainer(DefaultFont);
        }

        #endregion Constructors

        #region Properties

        public bool AllowCaretBeyondEOL
        {
            get {
                return allowCaretBeyondEOL;
            }
            set {
                allowCaretBeyondEOL = value;
            }
        }

        public bool AutoInsertCurlyBracket
        {
            get {
                return autoInsertCurlyBracket;
            }
            set {
                autoInsertCurlyBracket = value;
            }
        }

        public BracketMatchingStyle BracketMatchingStyle
        {
            get {
                return bracketMatchingStyle;
            }
            set {
                bracketMatchingStyle = value;
            }
        }

        public bool ConvertTabsToSpaces
        {
            get {
                return convertTabsToSpaces;
            }
            set {
                convertTabsToSpaces = value;
            }
        }

        public bool CutCopyWholeLine
        {
            get {
                return cutCopyWholeLine;
            }
            set {
                cutCopyWholeLine = value;
            }
        }

        public DocumentSelectionMode DocumentSelectionMode
        {
            get {
                return documentSelectionMode;
            }
            set {
                documentSelectionMode = value;
            }
        }

        public bool EnableFolding
        {
            get {
                return enableFolding;
            }
            set {
                enableFolding = value;
            }
        }

        public Encoding Encoding
        {
            get {
                return encoding;
            }
            set {
                encoding = value;
            }
        }

        public Font Font
        {
            get {
                return fontContainer.DefaultFont;
            }
            set {
                fontContainer.DefaultFont = value;
            }
        }

        public FontContainer FontContainer
        {
            get {
                return fontContainer;
            }
        }

        public bool HideMouseCursor
        {
            get {
                return hideMouseCursor;
            }
            set {
                hideMouseCursor = value;
            }
        }

        public IndentStyle IndentStyle
        {
            get {
                return indentStyle;
            }
            set {
                indentStyle = value;
            }
        }

        public int IndentationSize
        {
            get { return indentationSize; }
            set { indentationSize = value; }
        }

        public bool IsIconBarVisible
        {
            get {
                return isIconBarVisible;
            }
            set {
                isIconBarVisible = value;
            }
        }

        public string LineTerminator
        {
            get {
                return lineTerminator;
            }
            set {
                lineTerminator = value;
            }
        }

        public LineViewerStyle LineViewerStyle
        {
            get {
                return lineViewerStyle;
            }
            set {
                lineViewerStyle = value;
            }
        }

        public bool MouseWheelScrollDown
        {
            get {
                return mouseWheelScrollDown;
            }
            set {
                mouseWheelScrollDown = value;
            }
        }

        public bool MouseWheelTextZoom
        {
            get {
                return mouseWheelTextZoom;
            }
            set {
                mouseWheelTextZoom = value;
            }
        }

        public bool ShowEOLMarker
        {
            get {
                return showEOLMarker;
            }
            set {
                showEOLMarker = value;
            }
        }

        public bool ShowHorizontalRuler
        {
            get {
                return showHorizontalRuler;
            }
            set {
                showHorizontalRuler = value;
            }
        }

        public bool ShowInvalidLines
        {
            get {
                return showInvalidLines;
            }
            set {
                showInvalidLines = value;
            }
        }

        public bool ShowLineNumbers
        {
            get {
                return showLineNumbers;
            }
            set {
                showLineNumbers = value;
            }
        }

        public bool ShowMatchingBracket
        {
            get {
                return showMatchingBracket;
            }
            set {
                showMatchingBracket = value;
            }
        }

        public bool ShowSpaces
        {
            get {
                return showSpaces;
            }
            set {
                showSpaces = value;
            }
        }

        public bool ShowTabs
        {
            get {
                return showTabs;
            }
            set {
                showTabs = value;
            }
        }

        public bool ShowVerticalRuler
        {
            get {
                return showVerticalRuler;
            }
            set {
                showVerticalRuler = value;
            }
        }

        public int TabIndent
        {
            get {
                return tabIndent;
            }
            set {
                tabIndent = value;
            }
        }

        public System.Drawing.Text.TextRenderingHint TextRenderingHint
        {
            get { return textRenderingHint; }
            set { textRenderingHint = value; }
        }

        public bool UseCustomLine
        {
            get {
                return useCustomLine;
            }
            set {
                useCustomLine = value;
            }
        }

        public int VerticalRulerRow
        {
            get {
                return verticalRulerRow;
            }
            set {
                verticalRulerRow = value;
            }
        }
        
        public Color BracketHighlightInnerColor
        {
            get {
                return bracketHighlightInnerColor;
            }
            set {
                bracketHighlightInnerColor = value;
            }
        }

        public Color BracketHighlightOutlineColor
        {
            get {
                return bracketHighlightOutlineColor;
            }
            set {
                bracketHighlightOutlineColor = value;
            }
        }

        #endregion Properties
    }
}